﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WebAdmin_WebAdminLogin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.ClientScript.RegisterClientScriptInclude(Page.GetType(), "jquery-1.7.js", ResolveClientUrl("~/Resources/Javascript/jquery-1.7.js"));
        imgLogin_Click(null, null);
    }

    protected void imgLogin_Click(object sender, ImageClickEventArgs e)
    {
        if (txtUserName.Text.ToLower() == "admin@admin.com" && txtPassword.Text.ToLower() == "admin")
        {
            Session["Username"] = "admin";
            string fileName = Convert.ToString(Request.QueryString["fileName"]);
            if (String.IsNullOrEmpty(fileName))
            {
                Response.Redirect("ManageSites.aspx");
            }
            else
            {
                Response.Redirect("../" + fileName);
            }
        }
    }
}